﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SignInManager : MonoBehaviour
{
    Text moneyValue;//元宝数
    public GameObject panel;
    public Text t;
    public GameObject image;
    public GameObject yindaoPanel;
    public GameObject yindao4;
    public GameObject tishi;
    void Start()
    {
        moneyValue = GameObject.Find("moneyValue").GetComponent<Text>();
        moneyValue.text = VariableDocument.GetInstance.money.ToString();
        if(VariableDocument.GetInstance.signin == 1)
        {
            image.SetActive(true);
            t.text = "1";
            yindao4.transform.GetChild(0).gameObject.SetActive(false);
            yindao4.transform.GetChild(1).gameObject.SetActive(false);
            yindaoPanel.SetActive(false);
        }
        if (VariableDocument.GetInstance.signin == 0)
        {
            yindaoPanel.SetActive(true);
            yindaoPanel.transform.GetChild(0).gameObject.SetActive(true);
        }
    }

    public void ClickOne()
    {
        if (VariableDocument.GetInstance.signin == 0 )
        {
            t.text = "1";
            panel.SetActive(true);
            image.SetActive(true);
            VariableDocument.GetInstance.signin = 1;
            yindaoPanel.transform.GetChild(0).gameObject.SetActive(false);
            yindaoPanel.transform.GetChild(1).gameObject.SetActive(true);
        }
        
    }
    public void ClickOther()
    {
        tishi.SetActive(true);
        Invoke("tishixiaoshi", 1f);
    }
    void tishixiaoshi()
    {
        tishi.SetActive(false);
    }
    public void ClickBack()
    {
        panel.SetActive(false);
        yindaoPanel.transform.GetChild(1).gameObject.SetActive(false);
        yindaoPanel.SetActive(false);
        yindao4.transform.GetChild(0).gameObject.SetActive(true);
        yindao4.transform.GetChild(1).gameObject.SetActive(true);
        VariableDocument.GetInstance.yindaoid = 5;
    }
   
}
